package Demo2;

public class Test {
    //    public static void main(String[] args) {
//        //泛型方法
////        Integer i1 = 100;
////        Integer i2 = 200;
////        Integer ret = MyMath.<Integer>IntegerCompare(i1, i2);
////        System.out.println(ret);
//
//        //泛型方法其适用性较高
////        Integer[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
////        String[] array = {"zhangsan", "lisi", "wangwu", "zhaoliu"};
////        String ret = MyArray.<String>getArray(array, 0);
////        System.out.println(ret);
//
//    }
//    public static void main(String[] args) {
//        //17新增特性
//        //switch
////        String str = "one";
////        int ret = 0;
////        switch (str){
////            case "one":
////                ret = 1;
////                break;
////            case "two":
////                ret = 2;
////                break;
////            default:
////                ret = -1;
////                break;
////        }
////        System.out.println(ret);
//
//        //使用箭头来返回值
////        String str = "one";
////        int ret = switch (str){
////            case "one" ->1;
////            case "two"->2;
////            default -> -1;
////        };
////        System.out.println(ret);
//
//
//        //使用yield来返回case的值
////        String str = "one";
////        int ret = switch (str) {
////            case "one":
////                yield 1;
////            case "two":
////                yield 2;
////            default:
////                yield -1;
////        };
////        System.out.println(ret);
//
//
//        //使用var来创建变量
////        var a = 100;
////        var str = "hello";
////        var mymath = new MyMath();
//
////        String str = "hello";
////        if(str instanceof String a){
////            a = "world";
////        }
////        System.out.println(str);
//
//    }
    public static void main(String[] args) {

    }
}
